﻿using DistributedVisionRunner.Module.ViewModels;
using System;
using System.Windows.Controls;

namespace DistributedVisionRunner.Module.Views
{
    /// <summary>
    /// Interaction logic for VisionProcessUnitView.xaml
    /// </summary>
    public partial class VisionProcessUnitView : UserControl
    {

        public VisionProcessUnitView()
        {
            InitializeComponent();

            Dispatcher.ShutdownStarted += OnDispatcherShutdownStarted;



        }

        private void OnDispatcherShutdownStarted(object sender, EventArgs e)
        {
            var vm = (IVisionProcessUnit)DataContext;
            vm?.ShutdownZeroMQServerIfAny();
        }
    }
}
